# -*- coding: utf-8 -*-
"""爬取豆瓣电影经典电影前500
Created on Tue Jul 11 15:37:50 2017

@author: world
"""
import requests

url = 'https://movie.douban.com/j/search_subjects?type=movie&tag=经典&sort\
=recommend&page_limit=300&page_start=0'
text = requests.get(url).content
r = json.loads(text)
for value in r.values():
    print('{:^6}{:^8}{:^7}{:^40}{:^5}{:^10}'.format('序号','评分','cover_x',
          '链接','能否免费播放','影片名',))
    for i in range(300):
        print('{:^8}{:^8}{:^7}{:^40}{:^10}{:^10}'.format(i,value[i]['rate'],
              value[i]['cover_x'],value[i]['url'],value[i]['playable'],value[i]['title']))





